﻿@using System.Diagnostics
@using Super.Infrastructure
@{
    Layout = null;

    var groupList = CacheService.GetShopCategory();
    var LeftNavs = groupList.OrderBy(a => a.LeftIndex).ToList();
    var leftParents = LeftNavs.Where(a => a.ParentId == 0);

    var loveModel = CacheService.UserLove().FirstOrDefault();
    
}
<div class="m_left fl">
    @{
        if (loveModel != null)
        {
        <div class="n_left line mb10">
            <div class="n_l_tit">
            </div>
            <table width="138" border="0" cellspacing="0">
                <tr>
                    <td>
                     <a href="@loveModel.Href"><img src="@loveModel.Image" width="140" height="180" /></a>
                    </td>
                </tr>
                <tr>
                    <td class="f14">对象：@loveModel.Lover</td>
                </tr>
                <tr>
                    <td class="f14">我：@loveModel.Me</td>
                </tr>
                <tr>
                    <td>
                        <div class="n_l_an">
                        </div>
                        <div class="n_l_xl">@loveModel.Detail</div>
                    </td>
                </tr>
                <tr>
                    <td align="center" class=" pt20 pb20">已有<b class="c_red f14">@loveModel.BlessingCount</b>人祝福</td>
                </tr>
                <tr>
                    <td><a  href="javascript:void(0)" onclick="AddLove();"  class="btn_22">我要报名</a> <a href="javascript:void(0)" class="btn_21" onclick="Give();">送上祝福</a></td>
                </tr>
            </table>
            <script type="text/javascript">
                function AddLove() {
                    if (@SuperService.LoginUser.UserID >0){
                        window.location = '/love';

                    }else {

                        var submit = function (v, h, f) {
                            if (v == 'ok')
                                window.location = '/login';
                            return true; //close
                        };
                        $.jBox.confirm("您还没有登录,现在去登录？", "VIP结婚网提示", submit);

                    }
                };
                
                function Give() {
                    var url = '/love/give/@loveModel.ID?random=1'+ Math.random();
                    $.jBox.tip("正在执行操作...", 'loading');
                    $.get(url, function (data) {
                        $.jBox.closeTip();
                        if (data == 'nologin') {
                            var submit = function (v, h, f) {
                                if (v == 'ok')
                                    window.location = '/login';
                                return true; //close
                            };
                            $.jBox.confirm("您还没有登录,现在去登录？", "VIP结婚网提示", submit);
                        } else {
                            var json = eval('(' + data + ')');
                            $.jBox.tip(json.result, 'sucess', { timeout: 2000 });
                        }
                    });
                }
            </script>
        </div>
        }
    }
    <!--/n_left-->
    <div class="sidebar">
        <ul>
            <li class="s_01"><a href="/topic"><span>经验交流</span></a></li>
            @{
                var Leftindex = 2;
                foreach (var leftParent in leftParents)
                {
                    var childs = LeftNavs.Where(a => a.ParentId == leftParent.ID);
                            
                <li class="s_0@(Leftindex)"><span><a href="/shoplist/@leftParent.ID">@leftParent.Name</a></span>
                    <ul>
                        @{
                    foreach (var category in childs)
                    {
                            <li><a href="/shoplist/@category.ID">@category.Name</a></li>
                    }
                        }
                    </ul>
                </li>
                    Leftindex++;
                }
            }
        </ul>
    </div>
    <!--/sidebar-->
    <script type="text/javascript">
        $(".sidebar ul li ul li a").hover(
            function () {
                $(this).addClass("bg_c");
            },
            function () {
                $(this).removeClass("bg_c");
            }
        );

    //sidebar hover样式
    </script>
</div>
<!--mian_left-->
